<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
    <script src="./axios.js"></script>

    <!-- 轮播图样式 js -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css" />
    <script src="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.js"></script>
    <style>
        .active {
            color: red;
        }

        .active1 {
            font-size: 50px;
        }

        .active2 {
            background-color: aquamarine;
        }

        .active3 {
            border: 5px solid #ccc;
        }

        .a {
            background-color: pink;
            padding: 50px;
        }

        .b {
            background-color: skyblue;
            padding: 50px;
        }

        .c {
            background-color: rgb(21, 204, 64);
            padding: 50px;
        }

        .swiper {
            width: 600px;
            height: 300px;
        }
    </style>
</head>

<body>
    <div id="app">

        <!-- 轮播图结构 -->
        <!-- Slider main container -->
        <div class="swiper">
            <!-- Additional required wrapper -->
            <div class="swiper-wrapper">
                <!-- Slides -->
                <div class="swiper-slide">Slide 1</div>
                <div class="swiper-slide">Slide 2</div>
                <div class="swiper-slide">Slide 3</div>
                ...
            </div>
            <!-- If we need pagination -->
            <div class="swiper-pagination"></div>

            <!-- If we need navigation buttons -->
            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>

            <!-- If we need scrollbar -->
            <div class="swiper-scrollbar"></div>
        </div>


        <div>----------------------------------</div>
        <!-- 事件 -->
        <!-- <button v-on:事件类型="事件驱动函数">按钮</button> -->
        <!-- 简写 (推荐)  <button @click="事件驱动函数"></button> -->
        <button v-on:click="handClick">按钮1</button>
        <button @click="handClick(11)">按钮2</button>

        <!-- 事件修饰符  stop  阻止冒泡 -->
        <!-- 事件修饰符  once  只执行一次 -->
        <!-- 事件修饰符  prevent  阻止默认行为 -->
        <div @click.once="fun1" class="a">
            <div @click="fun2" class="b">
                <div @click.stop="fun3" class="c"></div>
            </div>
        </div>

        <a href="https://www.baidu.com/" @click.prevent>百度一下</a>
    </div>



    <script>
        const { createApp } = Vue;

        createApp({
            data() {
                return {

                }
            },
            methods: {
                handClick(count) {
                    console.log(count);
                },
                fun1() {
                    console.log('fun1');
                },
                fun2() {
                    console.log('fun2');
                },
                fun3() {
                    console.log('fun3');
                },
            }
        }).mount('#app')


        // 轮播图
        const swiper = new Swiper('.swiper', {
            // Optional parameters
            // direction: 'vertical',
            loop: true,

            // If we need pagination
            pagination: {
                el: '.swiper-pagination',
            },

            // Navigation arrows
            navigation: {
                nextEl: '.swiper-button-next',
                prevEl: '.swiper-button-prev',
            },
        });


    </script>
</body>

</html>